package com.sc.nft.service;

import com.sc.nft.entity.minimall.MallUserWallet;
import com.sc.nft.enums.MallUserWalletDetailTypeEnum;

import java.math.BigDecimal;

/**
 * <p>
 * 商城用户钱包 服务类
 * </p>
 *
 * @author author
 * @since 2024-05-20
 */
public interface MallUserWalletService {

    /**
     * 获取商城用户钱包
     *
     * @param miniUserId
     * @return
     */
    MallUserWallet getMallUserWallet(Long miniUserId);

    /**
     * 添加收入
     *
     * @param mallUserWallet
     * @param amount
     * @return
     */
    void addRevenue(MallUserWallet mallUserWallet, BigDecimal amount, MallUserWalletDetailTypeEnum mallUserWalletDetailTypeEnum);

    /**
     * 添加提现金额(用户申请提现)
     *
     * @param mallUserWallet
     * @param amount
     * @return
     */
    Long addWithdrawingAmount(MallUserWallet mallUserWallet, BigDecimal amount, MallUserWalletDetailTypeEnum mallUserWalletDetailTypeEnum);

    /**
     * 提现成功
     *
     * @param mallUserWallet
     * @param amount
     * @return
     */
    void addSumWithdraw(MallUserWallet mallUserWallet, BigDecimal amount);

    /**
     * 提现失败
     *
     * @param mallUserWallet
     * @param amount
     * @return
     */
    void subWithdrawingAmount(MallUserWallet mallUserWallet, BigDecimal amount, MallUserWalletDetailTypeEnum mallUserWalletDetailTypeEnum);

    /**
     * 用户注册初始化钱包
     * @param miniUserId
     * @return
     */
    boolean initWallet(Long miniUserId);
}
